/*
 *  Copyright 2008-2010 www.jrails.org
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package org.rails.extjs.menu;

import org.rails.extjs.Component;
import org.rails.extjs.Option;
import org.rails.extjs.javascript.Function;

public abstract class BaseItem extends Component {

	public BaseItem() {
		super();
	}

	public BaseItem(Option configOptions) {
		super(configOptions);
	}

	public BaseItem(String id) {
		super(id);
	}
	
	public void setActiveClass(String activeClass){
		addOption("activeClass", activeClass);
	}
	
	public String getActiveClass(){
		return getString("activeClass","x-menu-item-active");
	}
	
	public void setCanActivate(Boolean canActivate){
		addOption("canActivate", canActivate);
	}
	
	public Boolean isCanActivate(){
		return getBoolean("canActivate",false);
	}
	
	public void setClickHideDelay(Function clickHideDelay){
		addOption("clickHideDelay", clickHideDelay);
	}
	
	public Function getClickHideDelay(){
		return (Function)getOption("clickHideDelay");
	}
	
	public void setHandler(Function handler){
		addOption("handler", handler);
	}
	
	public Function getHandler(){
		return (Function)getOption("handler");
	}
	
	public void setHideOnClick(Boolean hideOnClick){
		addOption("hideOnClick", hideOnClick);
	}
	
	public Boolean isHideOnClick(){
		return getBoolean("hideOnClick", true);
	}

	
}
